package net.zjitc.utils;

import java.util.List;

/**
 * Created by Administrator on 2017/11/22.
 */
public class PageBean<E> {
    //页面传入
    private int page;//当前第几页
    private int pageSize;//页面大小

    //从数据库查询
    private List<E> pageList;//页面数据
    private int count;//数据的总条数

    //计算出来
    private int pageCount;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public List<E> getPageList() {
        return pageList;
    }

    public void setPageList(List<E> pageList) {
        this.pageList = pageList;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getPageCount() {
        pageCount=count/pageSize;
        return (count%pageSize) == 0 ? pageCount:pageCount+1;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

}
